package entity

import "gitee.com/linxing_3/sr-core/domain/model"

func NewSysRegion() *SysRegion {
	return &SysRegion{}
}

// 省市区字典
type SysRegion struct {
	Id   int    `json:"id" form:"id" gorm:"column:id;primaryKey;comment:城市代码"`
	Name string `json:"name" form:"name" gorm:"column:name;comment:城市名称" search:"type:contains"`
	Pid  int    `json:"pid" form:"pid" gorm:"column:pid;comment:父级城市代码"`

	Children []*SysRegion `json:"children" gorm:"foreignKey:Pid;references:Id"`
	model.GAllInject
}

func (SysRegion) TableName() string {
	return "sys_region"
}
